﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FineUI;
using OnlineTestModel;
using OnlineTestBLL;

namespace OnlineTestUI.BackManager
{
    public partial class addstudent : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void BtAdd_Click(object sender, EventArgs e)
        {
            Students s = new Students();
            StudentsBLL sb = new StudentsBLL();
            s.RealName = tbRealName.Text;
            s.UserName = tbUserName.Text;
            s.PassWord = tbPassWord.Text;
            s.ClassId = 1;
            s.Description = tbDescription.Text;
            s.RoleId = Convert.ToInt32(tbRoleId.Text);
            s.RoleList = tbRoleList.Text;
            s.Status = 1;
            s.CreateTime = DateTime.Now;
            s.CreateId = 1;
            //s.CreateId = ((Teachers)Session["teacher"]).Id;
            s.LastLoginTime = null;
            int result = sb.Add(s);
            if (result > 0)
            {
                PageContext.Redirect("studentlist.aspx", "_self");
            }
        }
    }
}